﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.Master" AutoEventWireup="true"
    CodeBehind="materiaMng.aspx.cs" Inherits="Fitment.Admin.materiaMng" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="InputContentPlaceHolder" runat="server">
    <asp:Panel ID="Panel1" Height="480px" ScrollBars="Vertical" runat="server">
        <div align="center">
       
            <br />
            <asp:Button ID="searchButton" runat="server" Text="查询全部" OnClick="searchButton_Click"
                Style="height: 26px" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="query" runat="server" Text="按材料名查询" OnClick="query_Click" Width="88px"
                Style="height: 26px" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:TextBox ID="material" runat="server" Width="99px"></asp:TextBox>
            <br />
        </div>
        <div>
            <table border="0" cellpadding="1" cellspacing="1" class="style19">
                <tr>
                    <td class="style21">
                        <div align="right">
                            <span lang="zh-cn">材料名称：</span>
                        </div>
                    </td>
                    <td class="style22">
                        <div align="left">
                            <asp:TextBox ID="matName" runat="server"></asp:TextBox>
                        </div>
                    </td>
                    <td class="style14">
                        <div align="right">
                            <span lang="zh-cn">工程名：</span>
                        </div>
                    </td>
                    <td class="style13">
                        <asp:TextBox ID="Project" runat="server" Width="101px"></asp:TextBox>
                    </td>
                    <td class="style11">
                        <div align="right">
                            <span lang="zh-cn">最低</span>单价(元/平方米)：</div>
                    </td>
                    <td class="style17">
                        <div align="left">
                            <asp:TextBox ID="areaPrice" runat="server" Width="99px">0</asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="areaPrice"
                                ErrorMessage="必填数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="style21">
                        <div align="right">
                            工种：</div>
                    </td>
                    <td class="style22">
                        <div align="left">
                            <asp:DropDownList ID="type" runat="server" DataSourceID="SqlDataSource1" DataTextField="WorkType"
                                DataValueField="WorkType">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connection %>"
                                SelectCommand="SELECT [WorkType] FROM [WorkerInfo]"></asp:SqlDataSource>
                        </div>
                    </td>
                    <td class="style14">
                        <div align="right">
                            符合类型：</div>
                    </td>
                    <td class="style13">
                        <div align="left">
                            <asp:DropDownList ID="roomType" runat="server">
                                <asp:ListItem>客厅</asp:ListItem>
                                <asp:ListItem>厨房</asp:ListItem>
                                <asp:ListItem>书房</asp:ListItem>
                                <asp:ListItem>卧室</asp:ListItem>
                                <asp:ListItem>卫生间</asp:ListItem>
                                <asp:ListItem>通用</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </td>
                    <td class="style11">
                        <div align="right">
                            <span lang="zh-cn">最低</span>单价(元/个<span lang="zh-cn">/米：</span>)</div>
                    </td>
                    <td class="style17">
                        <div align="left">
                            <asp:TextBox ID="numPrice" runat="server" Width="99px">0</asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="numPrice"
                                ErrorMessage="必填数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="style21">
                        <div align="right" style="width: 216px">
                            <span lang="zh-cn">工程时间(天)</span>：</div>
                    </td>
                    <td class="style22">
                        <div align="left">
                            <asp:TextBox ID="ProTime" runat="server" Width="44px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="ProTime"
                                ErrorMessage="必填数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator>
                        </div>
                    </td>
                    <td class="style14">
                        &nbsp;
                    </td>
                    <td class="style13">
                        &nbsp;
                    </td>
                    <td class="style11">
                        &nbsp;
                    </td>
                </tr>
            </table>
            <br />
            <div align="center">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                            BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
                            CellPadding="4" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDeleting="GridView1_RowDeleting"
                            OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                            CssClass="style20" Width="693px">
                            <RowStyle BackColor="White" ForeColor="#330099" />
                            <Columns>
                                <asp:TemplateField HeaderText="材料名称">
                                    <ItemTemplate>
                                        <asp:Label ID="name" runat="server" Text='<%# Bind("MatName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="最低单价(元/平方米)">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="areaPrice" runat="server" Text='<%# Bind("Price_Area") %>' Height="18px"
                                            Width="55px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Price_Area") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="最低单价(元/个/米)">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="numPrice" runat="server" Text='<%# Bind("Price_Num") %>' Height="16px"
                                            Width="48px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Price_Num") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="工种">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="type" runat="server" DataSourceID="SqlDataSource1" DataTextField="WorkType"
                                            DataValueField="WorkType" SelectedValue='<%# Bind("WorkType") %>'>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("WorkType") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="符合类型">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="roomType" runat="server" SelectedValue='<%# Bind("MatchType") %>'>
                                            <asp:ListItem>书房</asp:ListItem>
                                            <asp:ListItem>卧室</asp:ListItem>
                                            <asp:ListItem>客厅</asp:ListItem>
                                            <asp:ListItem>厨房</asp:ListItem>
                                            <asp:ListItem>卫生间</asp:ListItem>
                                            <asp:ListItem>通用</asp:ListItem>
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("MatchType") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="需要时间">
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("NeedTime") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="days" runat="server" Height="16px" Text='<%# Bind("NeedTime") %>'
                                            Width="47px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="工程名称">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ProName") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="project" runat="server" Height="22px" Text='<%# Bind("ProName") %>'
                                            Width="119px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="更新"></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="取消"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="修改"></asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="删除" OnClientClick="javascript:return confirm('删除将无法恢复了哦？');"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                        </asp:GridView>
                    </ContentTemplate>
                    <Triggers>
                        <asp:PostBackTrigger ControlID="GridView1" />
                    </Triggers>
                </asp:UpdatePanel>
            </div>
            <br />
            <div align="center">
                <asp:Button ID="Button3" runat="server" Text="添加" Height="25px" Width="78px" OnClick="addButton_Click" />
            </div>
        </div>
    </asp:Panel>
</asp:Content>
